#include "UI_h/loginui.h"
#include "ui_loginui.h"
#include "../ServiceImp_h/LoginImp.h"
#include "../Entity_h/user.h"
#include "../DataBase_h/DataTableConfig.h"

LoginUI::LoginUI(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::LoginUI)
{
    ui->setupUi(this);
}

LoginUI::~LoginUI()
{
    delete ui;
}

void LoginUI::on_pushButtonLogin_clicked()
{
    QString userID = ui->lineEditID->text();
    QString userPwd = ui->lineEditPwd->text();

    UserTable curUserTable("UserTable","UserId","UserPwd");
    UserInfo curUserInfo(userID, userPwd);
    User curUser(curUserInfo);
    _loginService = new LoginImp(curUserTable);
    _loginService->CheckUser(curUser);


}

void LoginUI::on_pushButtonRegister_clicked()
{

}
